import copy

# 原始列表
original_list = [1, 2, [3, 4]]

# 浅拷贝
shallow_copy = copy.copy(original_list)

# 深拷贝
deep_copy = copy.deepcopy(original_list)

# 修改浅拷贝中的嵌套列表
shallow_copy[2][0] = 'X'
print("Original List after shallow copy modification:", original_list)  # 输出: [1, 2, ['X', 4]]
print("Shallow Copy after modification:", shallow_copy)  # 输出: [1, 2, ['X', 4]]

# 修改深拷贝中的嵌套列表
deep_copy[2][0] = 'Y'
print("Original List after deep copy modification:", original_list)  # 输出: [1, 2, ['X', 4]]
print("Deep Copy after modification:", deep_copy)  # 输出: [1, 2, ['Y', 4]]